﻿﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IPagedList<sp_GetPromotionPartnerResult>>" %>

<ul>
    <%foreach(sp_GetPromotionPartnerResult obj in ViewData.Model)
      {%>
        <li>
            <div class="cimage">
                <img src="<%=Constants.PHOTO_PATH_ROOT_PARTNER + obj.Logo%>" width="208" height="132" /></div>
            <a class="textlink2 text" href="<%=FRouter._("cuahang",obj.ID.ToString(),obj.PartnerName) %>">
                <strong>
                    <%=Html.Encode(obj.PartnerName)%></strong></a>
            <div class="style">
                <%=Html.Encode(CommonFunc.GetMainPartnerAddress(obj.ID))%>
                <br />
                Ðiện thoại:
                <%=obj.RepresentativePhone%>
                <br />
                Giảm giá:
                <%=HttpUtility.HtmlEncode(obj.DiscountInfo)%>
            </div>
        </li>
        <%} %>
    </ul>


<div class="clrfix"></div>
<div class="pagination">
    <%= Ajax.Pager(new AjaxOptions { UpdateTargetId = "thupartner", OnBegin = "beginPaging", OnSuccess = "successPaging", OnFailure = "failurePaging" },
                     ViewData.Model.PageSize, ViewData.Model.PageNumber, ViewData.Model.TotalItemCount, new { controller = "Home", action = "Index" })%>
</div>
<script type="text/javascript">

    function beginPaging(args) {
        // Animate
        $('#thupartner').fadeOut('normal');
    }

    function successPaging() {
        // Animate
        $('#thupartner').fadeIn('normal');
    }

    function failurePaging() {
        alert("Could not retrieve products.");
    }

    </script>